package Month07.day24.stu;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class test1 {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();
        collection.add("asa");
        collection.add("def");
        collection.add("agd");
        collection.add("def");
        collection.add("def");
        collection.add("okj");
        Iterator<String> it = collection.iterator();
        while (it.hasNext()) {
            String s = it.next();
            if (s.equals("def")) {
            it.remove();
            }
        }
        System.out.println(collection);
    }
}
